package tools;

import tools.vetorial.VectorialSelectionTool;
import core.DrawContext;
import core.VectorialObject;

public class ResizeTool extends VectorialSelectionTool {

	private DrawContext mDrawContext;
	
	@Override
	public void init(DrawContext ctx) {
		super.init(ctx);
		mDrawContext = ctx;
	}

	public void resize(float x, float y) {
	
		for(VectorialObject obj : mDrawContext.getSelection()){
			obj.resize(x, y);
			mDrawContext.removeObject2d(obj);
			mDrawContext.addObject2d(obj);
		}
		
		mDrawContext.setChanged(true);
	}

	@Override
	public void onSelection(VectorialObject vo) {
		super.onSelection(vo);
	}
}
